package bj.actor

import scala.actors.Actor
import scala.actors.OutputChannel
import bj.card.Card

class HumanPlayer(personName: String, personBankRoll: Double, personBet: Double) extends 
				   Player(personName, personBankRoll, personBet) 
{
  def rName = personName
  def rBank = personBankRoll
  def rBet  = personBet
  
/*
  def analyze(upcard: Card): Request = {
    receive {
     case HitRequest(remotePid: Int) => println("Hello!"); return Hit(pid) 
    }
  }

*/
  /** Analyzes my best play using a condensed form of Basic Strategy. */
  def analyze(upcard: Card): Request = {
    // If my hand >= 17, we're staying
    if (value >= 17)
      return Stay(pid)

    // If I have ten or less, no harm in hitting
    if (value <= 10)
      return Hit(pid)

    // If the dealer can bust, we're staying
    if (upcard.value >= 2 && upcard.value <= 6)
      return Stay(pid)

    // Dealer must be showing, A, 7, 8, 9, or 10 so...
    // we must hit
    return Hit(pid)
  }
}